﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Attributes;

namespace SelfService.Model.Models
{
    public class SysDoctor : BasePoco
    {
        [Display(Name = "HisId")]
        [MaxLength(32)]
        public string Code { get; set; }

        [Display(Name = "医生名称")]
        [MaxLength(32)]
        public string Name { get; set; }

        [Display(Name = "诊室")]
        public SysRoom Room { get; set; }

        [Display(Name = "诊室")]
        public Guid? RoomId { get; set; }

        [Display(Name = "图片")]
        [StringLength(1024)]
        public string Photo { get; set; }

        [Display(Name = "职称")]
        [MaxLength(128)]
        public string DoctorLevel { get; set; }

        [Display(Name = "擅长信息")]
        public string Info { get; set; }

        [Display(Name = "总金额")]
        [MaxLength(20)]
        public string TotalFee { get; set; }

        [Display(Name = "诊疗费")]
        [MaxLength(20)]
        public string ExamFee { get; set; }

        [Display(Name = "挂号费")]
        [MaxLength(20)]
        public string ClinicFee { get; set; }

        [Display(Name = "工作日")]
        public DateTime Workday { get; set; }

        [Display(Name = "工作时段")]
        public List<DoctorWorkTimeInterval> WorkTimeIntervals { get; set; }
    }

    [MiddleTable]
    public class DoctorWorkTimeInterval : BasePoco
    {
        [JsonIgnore]
        public SysDoctor Doctor { get; set; }

        public SysTimeInterval TimeInterval { get; set; }

        public Guid DoctorId { get; set; }

        public Guid TimeIntervalId { get; set; }
    }
}
